package com.lottery.material.config;

import com.lottery.material.config.shiro.freemarker.ShiroTags;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

/**
 * Description：freemarker配置类
 * Created by 朱正磊 on 2019-03-25 13:23
 */
@Configuration
public class FreeMarkerConfig {

    private final freemarker.template.Configuration configuration;

    @Autowired
    public FreeMarkerConfig(freemarker.template.Configuration configuration) {
        this.configuration = configuration;
    }

    @PostConstruct
    public void setSharedVariable() {
        configuration.setSharedVariable("shiro", new ShiroTags());
    }

}
